package com.hhj.sell.converter;

import com.hhj.sell.dto.OrderDTO;
import com.hhj.sell.pojo.OrderMaster;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

public class OrderMaster2OrderdDTO {

    public static OrderDTO converter(OrderMaster orderMaster) {
        OrderDTO orderDTO = new OrderDTO();
        BeanUtils.copyProperties(orderMaster, orderDTO);
        return orderDTO;
    }

    public static List<OrderDTO> converter(List<OrderMaster> orderMasterList){
       return orderMasterList.stream().map(e -> converter(e)).collect(Collectors.toList());
    }



}
